package com.ktgj.customer.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.ktgj.customer.domain.PointRecord;
import com.ktgj.customer.domain.vo.IntegralVo;
import com.ktgj.customer.domain.vo.PointRecordListVo;

import javax.servlet.http.HttpServletRequest;

/**
 * 积分明细
Service接口
 * 
 * @author ruoyi
 * @date 2021-07-27
 */
public interface IPointRecordService 
{
    /**
     * 查询积分明细

     * 
     * @param pntRecordId 积分明细
ID
     * @return 积分明细

     */
    public PointRecord selectPointRecordById(Long pntRecordId);

    /**
     * 查询积分明细
列表
     * 
     * @param pointRecord 积分明细

     * @return 积分明细
集合
     */
    public List<PointRecord> selectPointRecordList(PointRecord pointRecord);

    /**
     * 新增积分明细

     * 
     * @param pointRecord 积分明细

     * @return 结果
     */
    public int insertPointRecord(PointRecord pointRecord);

    /**
     * 修改积分明细

     * 
     * @param pointRecord 积分明细

     * @return 结果
     */
    public int updatePointRecord(PointRecord pointRecord);

    /**
     * 批量删除积分明细

     * 
     * @param pntRecordIds 需要删除的积分明细
ID
     * @return 结果
     */
    public int deletePointRecordByIds(Long[] pntRecordIds);

    /**
     * 删除积分明细
信息
     * 
     * @param pntRecordId 积分明细
ID
     * @return 结果
     */
    public int deletePointRecordById(Long pntRecordId);

    //给会员加积分
    //(消费金额，订单描述，员工信息ID，客户基本信息ID，对应订单类型，对应订单号，原因详细说明)
    public int addPointRecord(BigDecimal price, String orderSourceDesc, Long employeeId, Long customerId, String orderType, Long orderId, String pntReasonDesc);

    //查询当前可用积分
    public Long queryUserCreditsNum(Long customerId);

    //查询当前用户的积分
    public IntegralVo queryUserCredits(Long customerId) throws Exception;

    //签到领取积分
    public int signIn(Long customerId);

    //花费资产
    public String spend(Long customerId, Long creditsNum, String orderType, Long orderId, String orderSourceDesc, Long couponId, Long employeeId) throws Exception;//会员id、要扣减的积分、订单类型、订单id、订单描述（客户端展示使用），例如机票 显示航程+航班号、使用优惠卷的id、预留款、操作员工id

    /**
     * 积分记录列表
     * */
    public List<PointRecord> pointRecordList(PointRecordListVo pointRecordListVo) throws Exception;

    /**
     * 会员积分调整
     * */
    public int adjustment(PointRecord pointRecord, HttpServletRequest request) throws Exception;

    /**
     * 积分审核
     * */
    public int pointReview(HttpServletRequest request, Long id) throws Exception;

    /**
     * 积分统计
     * */
    public Long integralStatistics(Long customerId) throws Exception;

    /**
     * 积分操作
     * */
    public boolean integralOperation(PointRecord pointRecord) throws Exception;

    /**
     * 当前会员可支配的积分
     * */
    public Long dominateIntegral(Long id);
}
